class Person:
    pass


class Student(Person):
    pass


class Worker(Person):
    pass


class Teacher(Person):
    pass


class PersonFactory:
    def get_person(self, p_type):
        if p_type == 't':
            return Teacher()
        elif p_type == 's':
            return Student()
        elif p_type == 'w':
            return Worker()
        else:
            return Person()


factory = PersonFactory()
stu = factory.get_person('s')
print(type(stu))

teacher = factory.get_person('t')
print(type(teacher))

p = factory.get_person('people')
print(type(p))
